<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__
</span><span class="hs-pragma">{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if !defined(TESTING) &amp;&amp; defined(__GLASGOW_HASKELL__)
</span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 708
</span><span class="hs-pragma">{-# LANGUAGE RoleAnnotations #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span class="hs-cpp">
#define USE_MAGIC_PROXY 1
</span><span class="hs-cpp">#endif
</span><span class="hs-cpp">
#if USE_MAGIC_PROXY
</span><span class="hs-pragma">{-# LANGUAGE MagicHash #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#include &quot;containers.h&quot;
</span><span>
</span><span id="line-21"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- Module      :  Data.Map.Merge.Strict</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- Copyright   :  (c) David Feuer 2016</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- License     :  BSD-style</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-28"></span><span class="hs-comment">--</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- This module defines an API for writing functions that merge two</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- maps. The key functions are 'merge' and 'mergeA'.</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- Each of these can be used with several different \&quot;merge tactics\&quot;.</span><span>
</span><span id="line-32"></span><span class="hs-comment">--</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- The 'merge' and 'mergeA' functions are shared by</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- the lazy and strict modules. Only the choice of merge tactics</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- determines strictness. If you use 'Data.Map.Merge.Strict.mapMissing'</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- from this module then the results will be forced before they are</span><span>
</span><span id="line-37"></span><span class="hs-comment">-- inserted. If you use 'Data.Map.Merge.Lazy.mapMissing' from</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- &quot;Data.Map.Merge.Lazy&quot; then they will not.</span><span>
</span><span id="line-39"></span><span class="hs-comment">--</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- == 'preserveMissing' inconsistency</span><span>
</span><span id="line-41"></span><span class="hs-comment">--</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- For historical reasons, the preserved values are //not// forced. To force</span><span>
</span><span id="line-43"></span><span class="hs-comment">-- them, use 'preserveMissing''.</span><span>
</span><span id="line-44"></span><span class="hs-comment">--</span><span>
</span><span id="line-45"></span><span class="hs-comment">-- == Efficiency note</span><span>
</span><span id="line-46"></span><span class="hs-comment">--</span><span>
</span><span id="line-47"></span><span class="hs-comment">-- The 'Control.Category.Category', 'Applicative', and 'Monad' instances for</span><span>
</span><span id="line-48"></span><span class="hs-comment">-- 'WhenMissing' tactics are included because they are valid. However, they are</span><span>
</span><span id="line-49"></span><span class="hs-comment">-- inefficient in many cases and should usually be avoided. The instances</span><span>
</span><span id="line-50"></span><span class="hs-comment">-- for 'WhenMatched' tactics should not pose any major efficiency problems.</span><span>
</span><span id="line-51"></span><span class="hs-comment">--</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- @since 0.5.9</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Map.Merge.Strict</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-55"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Simple merge tactic types</span></span><span>
</span><span id="line-56"></span><span>      </span><span class="annot"><a href="Data.Map.Internal.html#SimpleWhenMissing"><span class="hs-identifier">SimpleWhenMissing</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#SimpleWhenMatched"><span class="hs-identifier">SimpleWhenMatched</span></a></span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** General combining function</span></span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#merge"><span class="hs-identifier">merge</span></a></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>    </span><span class="annot"><span class="hs-comment">-- *** @WhenMatched@ tactics</span></span><span>
</span><span id="line-63"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#zipWithMaybeMatched"><span class="hs-identifier">zipWithMaybeMatched</span></a></span><span>
</span><span id="line-64"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#zipWithMatched"><span class="hs-identifier">zipWithMatched</span></a></span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span>    </span><span class="annot"><span class="hs-comment">-- *** @WhenMissing@ tactics</span></span><span>
</span><span id="line-67"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#mapMaybeMissing"><span class="hs-identifier">mapMaybeMissing</span></a></span><span>
</span><span id="line-68"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#dropMissing"><span class="hs-identifier">dropMissing</span></a></span><span>
</span><span id="line-69"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#preserveMissing"><span class="hs-identifier">preserveMissing</span></a></span><span>
</span><span id="line-70"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#preserveMissing%27"><span class="hs-identifier">preserveMissing'</span></a></span><span>
</span><span id="line-71"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#mapMissing"><span class="hs-identifier">mapMissing</span></a></span><span>
</span><span id="line-72"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#filterMissing"><span class="hs-identifier">filterMissing</span></a></span><span>
</span><span id="line-73"></span><span>
</span><span id="line-74"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Applicative merge tactic types</span></span><span>
</span><span id="line-75"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#WhenMissing"><span class="hs-identifier">WhenMissing</span></a></span><span>
</span><span id="line-76"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#WhenMatched"><span class="hs-identifier">WhenMatched</span></a></span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Applicative general combining function</span></span><span>
</span><span id="line-79"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#mergeA"><span class="hs-identifier">mergeA</span></a></span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span>    </span><span class="annot"><span class="hs-comment">-- *** @WhenMatched@ tactics</span></span><span>
</span><span id="line-82"></span><span>    </span><span class="hs-comment">-- | The tactics described for 'merge' work for</span><span>
</span><span id="line-83"></span><span>    </span><span class="hs-comment">-- 'mergeA' as well. Furthermore, the following</span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-comment">-- are available.</span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#zipWithMaybeAMatched"><span class="hs-identifier">zipWithMaybeAMatched</span></a></span><span>
</span><span id="line-86"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#zipWithAMatched"><span class="hs-identifier">zipWithAMatched</span></a></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span>    </span><span class="annot"><span class="hs-comment">-- *** @WhenMissing@ tactics</span></span><span>
</span><span id="line-89"></span><span>    </span><span class="hs-comment">-- | The tactics described for 'merge' work for</span><span>
</span><span id="line-90"></span><span>    </span><span class="hs-comment">-- 'mergeA' as well. Furthermore, the following</span><span>
</span><span id="line-91"></span><span>    </span><span class="hs-comment">-- are available.</span><span>
</span><span id="line-92"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#traverseMaybeMissing"><span class="hs-identifier">traverseMaybeMissing</span></a></span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#traverseMissing"><span class="hs-identifier">traverseMissing</span></a></span><span>
</span><span id="line-94"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#filterAMissing"><span class="hs-identifier">filterAMissing</span></a></span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Covariant maps for tactics</span></span><span>
</span><span id="line-97"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#mapWhenMissing"><span class="hs-identifier">mapWhenMissing</span></a></span><span>
</span><span id="line-98"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html#mapWhenMatched"><span class="hs-identifier">mapWhenMatched</span></a></span><span>
</span><span id="line-99"></span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><span class="hs-comment">-- ** Miscellaneous functions on tactics</span></span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#runWhenMatched"><span class="hs-identifier">runWhenMatched</span></a></span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Data.Map.Internal.html#runWhenMissing"><span class="hs-identifier">runWhenMissing</span></a></span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Map.Strict.Internal.html"><span class="hs-identifier">Data.Map.Strict.Internal</span></a></span><span>
</span><span id="line-107"></span></pre></body></html>